package rad.framework.mda.generator.template.main.webapp;

import org.eclipse.uml2.uml.*;
import java.util.*;
import rad.framework.mda.generator.util.*;

public class Pageflow
{
  protected static String nl;
  public static synchronized Pageflow create(String lineSeparator)
  {
    nl = lineSeparator;
    Pageflow result = new Pageflow();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"" + NL + "\txmlns:ui=\"http://java.sun.com/jsf/facelets\"" + NL + "\ttemplate=\"#{theme.pageflow}\">" + NL + "\t<ui:param name=\"title\" value=\"#{messages['";
  protected final String TEXT_2 = "_Menu']}\" />" + NL + "\t<ui:param name=\"startPage\" value=\"/jsf/";
  protected final String TEXT_3 = "/";
  protected final String TEXT_4 = ".xhtml\" />" + NL + "</ui:composition>";
  protected final String TEXT_5 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    
Region region = (Region) argument;

    stringBuffer.append(TEXT_1);
    stringBuffer.append(region.getName());
    stringBuffer.append(TEXT_2);
    stringBuffer.append(region.getName());
    stringBuffer.append(TEXT_3);
    stringBuffer.append(JsfHelper.getStartPage(region));
    stringBuffer.append(TEXT_4);
    stringBuffer.append(TEXT_5);
    return stringBuffer.toString();
  }
}
